'use strict'

/* 工具类 */

export default {
	//时间戳
	timestamp: () => {
		return Date.parse(new Date());
	},

	//随机字符串
	nonce: (len) => {
		len = len || 6;
		const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
		const maxPos = chars.length;
		let str = '';
		for (var i = 0; i < len; i++) {
		    str += chars.charAt(Math.floor(Math.random() * maxPos));
		}
		return str;
	}
}
